package com.ricohgag.util;


import org.springframework.core.convert.converter.Converter;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author ricohgag
 * @date 2018/8/28 14:53
 */
public class CustomDateConverter implements Converter<String, LocalDateTime> {

    @Override
    public LocalDateTime convert(String date){
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime ldt = LocalDateTime.parse(date,df);
        return ldt;
    }
}
